    var sortList = new Array();
    var sortSonList = new Array();

	function test1(){
	alert("enter");
	}
    function getMerdiseSort(baseURL){
    	alert("enter");
        sortList.length=0;
        sortSonList.length=0;
        var url = baseURL+"/getAllSortJson";
        jQuery.ajax({
            url:url,
            type: "POST",
            async: false,
            dataType:"json",
            success:function(json){
                jQuery.each(json,function(i,item){
                    if(item.roleId=="1"){
                        sortList.push(item);
                    }else{
                        sortSonList.push(item);
                    }
                });
                var firstGradeSorts = document.getElementById("firstGradeSort").options;
                firstGradeSorts.length=0;
                firstGradeSorts[0] =  new Option("1","");
                jQuery.each(sortList,function(j,item){
                    firstGradeSorts[firstGradeSorts.length] = new Option(item.sortName,item.sortCode);
                });
                changeSortCode(firstGradeSorts[0].value);
            }
        });
    }

    function changeSortCode(sortCode){
        var secondGradeSorts = document.getElementById("secondGradeSort").options;
        secondGradeSorts.length=0;
        secondGradeSorts[0] =  new Option("2","");
        jQuery.each(sortSonList,function(i,item){
            if(item.fatherCode == sortCode){
                secondGradeSorts[secondGradeSorts.length] = new Option(item.sortName,item.sortCode);
            }
        });
        
        if(secondGradeSorts.length<=0){
            changeSortCode2('0');
        }else{
            changeSortCode2(secondGradeSorts[0].value);
        }
        
    }

    function changeSortCode2(sortCode){
        var thirdGradeSorts = document.getElementById("thirdGradeSort").options;
        thirdGradeSorts.length=0;
        thirdGradeSorts[0] =  new Option("3","");
        jQuery.each(sortSonList,function(i,item){
            if(item.fatherCode == sortCode){
                thirdGradeSorts[thirdGradeSorts.length] = new Option(item.sortName,item.sortCode);
            }
        });
    }
